package com.example.demobk.mapper;

import com.example.demobk.entity.Userinfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {

     int reg(Userinfo userinfo);
     // 根据用户查询 userinfo 对象
     Userinfo getUserByName(@Param("username") String username);

     Userinfo getUserById(@Param("id") Integer id);
     List<Userinfo> getListByPage(@Param("username") String username,
                                  @Param("address") String address,
                                  @Param("email") String email,
                                  @Param("limit") Integer limit,
                                  @Param("offset") Integer offset);
     int getListByPageCount(@Param("username") String username,
                            @Param("address") String address,
                            @Param("email") String email);
     int del(@Param("id") Integer id);
     int dels(List<Integer> ids);
     int update(Userinfo userinfo);
     List<Userinfo> getAll();

     //添加用户
     int adds(Userinfo userinfo);
     Userinfo getUserByLoginName(@Param("loginname") String loginname);
     Userinfo getUserByUid(@Param("id") Integer id);


}
